package com.qidian.buy.controller;

import com.qidian.buy.pojo.ItemSpecifications;
import com.qidian.buy.service.ItemSpecificationsService;
import com.qidian.buy.util.pojo.QdResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author 戴着假发的程序员
 * @company 起点编程
 * @date 2023/9/8 11:04
 */
@RestController
@RequestMapping("/itemSpecifications")
public class ItemSpecificationsController {

    @Autowired
    private ItemSpecificationsService speService;

    @PostMapping("/save")
    public QdResult save(@RequestBody ItemSpecifications spe){
        return speService.save(spe);
    };
    @GetMapping("/queryByPage")
    public QdResult queryByPage(ItemSpecifications spe,@RequestParam(defaultValue = "1")int page,@RequestParam(defaultValue = "10")int limit){
        return speService.queryByPage(spe,page,limit);
    }
    @GetMapping("/get")
    public QdResult get(Long speId){
        return speService.queryById(speId);
    };
}
